#include "dam.h"

const int Dam::ID_WHITE_EMPTY=0;
const int Dam::ID_BLACK_EMPTY=1;
const int Dam::ID_WHITE_DAM=132;
const int Dam::ID_WHITE_KING_DAM=133;
const int Dam::ID_BLACK_DAM=134;
const int Dam::ID_BLACK_KING_DAM=135;
const int Dam::ID_BLACK_EMPTY_MOVE=136;
const int Dam::ID_WHITE_DAM_SELECTED=137;
const int Dam::ID_WHITE_KING_DAM_SELECTED=138;
const int Dam::ID_BLACK_DAM_SELECTED=139;
const int Dam::ID_BLACK_KING_DAM_SELECTED=140;

Dam::Dam(wxWindow*inparent,int type,int ID_Dam)
{
    parent=inparent;
    this->type=type;
    this->ID_Dam=ID_Dam;
    if (type==ID_WHITE_EMPTY)
    {
        dambutton = new wxBitmapButton(inparent,ID_Dam,wxBitmap(wxT("source\\whiteempty.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_BLACK_EMPTY)
    {
        dambutton = new wxBitmapButton(inparent,ID_Dam,wxBitmap(wxT("source\\blackempty.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_WHITE_DAM)
    {
        dambutton = new wxBitmapButton(inparent,ID_Dam,wxBitmap(wxT("source\\whitedam.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_WHITE_KING_DAM)
    {
        dambutton = new wxBitmapButton(inparent,ID_Dam,wxBitmap(wxT("source\\whitekingdam.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_BLACK_DAM)
    {
        dambutton = new wxBitmapButton(inparent,ID_Dam,wxBitmap(wxT("source\\blackdam.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_BLACK_KING_DAM)
    {
        dambutton = new wxBitmapButton(inparent,ID_Dam,wxBitmap(wxT("source\\blackkingdam.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_BLACK_EMPTY_MOVE)
    {
        dambutton = new wxBitmapButton(inparent,ID_Dam,wxBitmap(wxT("source\\blackemptymove.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_WHITE_DAM_SELECTED)
    {
        dambutton = new wxBitmapButton(inparent,ID_Dam,wxBitmap(wxT("source\\whitedamselected.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_WHITE_KING_DAM_SELECTED)
    {
        dambutton = new wxBitmapButton(inparent,ID_Dam,wxBitmap(wxT("source\\whitekingdamselected.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_BLACK_DAM_SELECTED)
    {
        dambutton = new wxBitmapButton(inparent,ID_Dam,wxBitmap(wxT("source\\blackdamselected.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_BLACK_KING_DAM_SELECTED)
    {
        dambutton = new wxBitmapButton(inparent,ID_Dam,wxBitmap(wxT("source\\blackkingdamselected.png"),wxBITMAP_TYPE_PNG));
    }

}

void Dam::ReType(int type)
{
    this->type=type;
    if (type==ID_WHITE_EMPTY)
    {
        dambutton->SetBitmapLabel(wxBitmap(wxT("source\\whiteempty.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_BLACK_EMPTY)
    {
        dambutton->SetBitmapLabel(wxBitmap(wxT("source\\blackempty.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_WHITE_DAM)
    {
        dambutton->SetBitmapLabel(wxBitmap(wxT("source\\whitedam.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_WHITE_KING_DAM)
    {
        dambutton->SetBitmapLabel(wxBitmap(wxT("source\\whitekingdam.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_BLACK_DAM)
    {
        dambutton->SetBitmapLabel(wxBitmap(wxT("source\\blackdam.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_BLACK_KING_DAM)
    {
        dambutton->SetBitmapLabel(wxBitmap(wxT("source\\blackkingdam.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_BLACK_EMPTY_MOVE)
    {
        dambutton->SetBitmapLabel(wxBitmap(wxT("source\\blackemptymove.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_WHITE_DAM_SELECTED)
    {
        dambutton->SetBitmapLabel(wxBitmap(wxT("source\\whitedamselected.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_WHITE_KING_DAM_SELECTED)
    {
        dambutton->SetBitmapLabel(wxBitmap(wxT("source\\whitekingdamselected.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_BLACK_DAM_SELECTED)
    {
        dambutton->SetBitmapLabel(wxBitmap(wxT("source\\blackdamselected.png"),wxBITMAP_TYPE_PNG));
    }
    else if (type==ID_BLACK_KING_DAM_SELECTED)
    {
        dambutton->SetBitmapLabel(wxBitmap(wxT("source\\blackkingdamselected.png"),wxBITMAP_TYPE_PNG));
    }
}
